<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>买家菜单</title>
    <script src="/js/Jquery.js"></script>
    <script src="/js/BuyerLoadShoppingCart.js"></script>
    <link rel="stylesheet" href="/css/BuyerMenuList.css">
</head>
<body>
    <div>
        <ul id="s">
            <li><a href=> 选桌 </a></li>
            <li><a href=""> >下单 </a></li>
            <li><a href="/buyer/order"> 订单 </a></li>
        </ul>
    </div>
    <div id="buyermenuList2">
    <table id="buyermenuList">
        <tr>
            <th colspan="6">菜单</th>
        </tr>
        <tr>
            <th id="first">图片</th><th>菜品id</th><th>菜品名称</th><th>价格</th><th>状态</th><th>操作</th>
        </tr>
        <tr th:each="foodmenu : ${menuHtml}"> <!--Thymeleaf-->
            <td><img th:src="@{${dishurl}+${foodmenu.id}+'.jpg'}" onerror="this.src='../images/Mysterious.jpg';this.οnerrοr=null;"></img></td>
            <td th:text="${foodmenu.id}"></td>
            <td th:text="${foodmenu.foodname}"></td>
            <td th:text="${foodmenu.foodprice}"></td>
            <td th:text="${foodmenu.foodstatus} == 1 ? '在售':'停售'"></td>
            <td><a th:href="@{'/cart/addCart/'+${foodmenu.id}}" href="javascript.void();">添加到购物车</a></td>
        </tr>
    </table>
    </div>
    <div id="buyerShoppingCart2">
        <table id="buyerShoppingCart">
            <tr>
                <th colspan="6">购物车</th>
            </tr>
            <tr>
                <th>菜品id</th><th>菜品名称</th><th>价格</th><th>数量</th><th colspan="2">操作</th>
            </tr>
        </table>
    </div>
    <a href="/order/addOrder2/"><button> 确认下单 </button></a>
<script>
    buyerLoadShoppingCart();
</script>
</body>
</html>